package cn.readjava.controller.manage;

import cn.readjava.bean.Website;
import cn.readjava.service.WebsiteService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/manage/website")
public class ManageWebsiteController {

    @Resource
    private WebsiteService websiteService;

    @GetMapping("/list")
    public String list(Model model) {
        List<Website> websiteList = websiteService.findAll();
        model.addAttribute("websiteList", websiteList);
        return "manage/manage-website";
    }
}
